<?php session_start(); ?> 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
<link rel="stylesheet" href="../css/ABC.css" type="text/css"/>
<script type="text/javascript" src="../js/form.js"></script>
</head>
</html>

<?php

include("../classes/ConnectionBDD.php");
include("../classes/Formulaires.php");
include("../classes/Intervenants.php");
include("../classes/FormulairesI.php");

$bdd = new Connector_Sql();
$frm = new Formulaires();
$frmI = new FormulairesI();
$port = new Portail();

mysql_connect('localhost','root','') or die('Connexion impossible a la BDD');
mysql_select_db('ABC PRO');

$frmI->debutFormulaire('Creer invite','cr_inv','creerInvite.php');
$frm->ligne_vide();
$frmI->textbox('Login:','log_inv');
$frmI->pwdbox('Mot de passe:','mdp_inv');
$frm->ligne_vide();
$frm->fin_formulaire();

//cree un intervenant en avertissant l'utilisateur avec un message popup
if (isset($_POST['log_inv']) and isset($_POST['mdp_inv'])) {

	$pwd = md5($_POST['mdp_inv']); //crypte le mot de passe
	
	if ($port->creerInvite($_POST['log_inv'],$pwd,$_SESSION['log'])) {
		echo "<script type='text/javascript'>alert(\"Invite ".$_POST['log_inv']." cree\");</script>";
	}
	
}

$bdd->deconnect();

?>
